<?php
include_once("../configure/admin.config.inc.php");	//--> admin global var
include_once("db.inc.php");							//--> db global var
include_once("Smarty.class.php");					//--> out template
include_once("Message.php");						//--> Message
include_once("Operation.php");						//--> Operation

require_once("controlHeader.php");					//--> system control header

$objOperate = new Operation();						//--> Operation
$objMessage	= new Message($uid);					//--> Message

$error_message 	= '';

$arrOperate = $objOperate->arrGetFromGroupIDAndMenuID($gid, $menuid);


$arrMessage = $objMessage->getFromID($arrOperate, $id);
if(is_array($arrMessage)){
	$strTitle 	= $arrMessage['title'];
	$strContent	= $arrMessage['content'];
	//$strContent	= str_replace(" ", "&nbsp;", str_replace("\n", "<br>", $$arrInfo['content']));
	
	$objMessage->editStatus($arrOperate, $id);
}

/*----- out html -----*/
$smarty = new Smarty();	//----- out template
$smarty->template_dir = TEMPLATE_SYS_DIR;
$smarty->compile_dir  = CACHE_SYS_DIR;

$smarty->assign('error_message', $error_message);
$smarty->assign('menuGid', $menuGid);
$smarty->assign('menuid', $menuid);

$smarty->assign('backurl',$backurl);

$smarty->assign('title', $strTitle);
$smarty->assign('content', $strContent);

$smarty->display('listMessage_View.htm');
?>
